//
//  UFType.h
//  Ufan
//
//  Created by yangqingluo on 15/11/10.
//  Copyright © 2015年 yangqingluo. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface UFType : NSObject



@end


@interface UFProduct : UFType

@property (nonatomic) NSString *idString;
@property (nonatomic) NSString *name;
@property (nonatomic) int inventory;
@property (nonatomic) int saledNum;
@property (nonatomic) int sellerLoad;
@property (nonatomic) NSString *price;
@property (nonatomic) NSString *mainUrl;
@property (nonatomic) NSString *hot;
@property (nonatomic) NSString *reserve;

NSArray *productsFromArray(NSArray *array);
UFProduct *productFromDic(NSDictionary *dic);

@end

@interface UFProductSell : UFType

@property (nonatomic) NSString *idString;
@property (nonatomic) NSString *name;
@property (nonatomic) int inventory;
@property (nonatomic) int saledNum;
@property (nonatomic) NSString *price;
@property (nonatomic) NSString *mainUrl;
@property (nonatomic) NSString *hot;
@property (nonatomic) NSString *reserve;
@property (nonatomic) NSUInteger orderCount;//预定数量
@property (nonatomic) NSUInteger starCount;//星级

NSArray *productSellsFromArray(NSArray *array);
UFProductSell *productSellFromDic(NSDictionary *dic);

@end

@interface UFSupplier : UFType

@property (nonatomic) NSString *name;
@property (nonatomic) NSString *descriptionString;
@property (nonatomic) NSString *logoUrl;
@property (nonatomic) NSString *siteUrl;
@property (nonatomic) NSString *shippingStatusShipped;
@property (nonatomic) NSString *shippingStatusReceiving;
@property (nonatomic) NSString *shippingStatusToBeShipped;
@property (nonatomic) NSString *orderStatusConfirmed;
@property (nonatomic) NSString *orderStatusToBeConfirmed;
@property (nonatomic) NSString *orderStatusCompleted;
@property (nonatomic) NSString *orderStatusCancelled;
@property (nonatomic) NSString *paymentStatusUnpaid;
@property (nonatomic) NSString *paymentStatusPaid;
@property (nonatomic) NSString *refund_STATUS_REFUND;
@property (nonatomic) NSString *refund_STATUS_NO_REFUND;
@property (nonatomic) NSString *refund_STATUS_COMPLETED;
@property (nonatomic) NSString *refund_STATUS_FAILURE;

UFSupplier * supplierFormDic(NSDictionary *dic);

@end

@interface UFItem : UFType

@property (nonatomic) int saleEarning;
@property (nonatomic) double samplePrice;
@property (nonatomic) NSString *name;
@property (nonatomic) NSString *idString;
@property (nonatomic) int inventory;
@property (nonatomic) double retailPrice;

UFItem *itemFromDic(NSDictionary *dic);

@end

@interface UFCategory : UFType

@property (nonatomic) NSString *idString;
@property (nonatomic) NSString *name;
@property (nonatomic) int sort;
@property (nonatomic) NSString *descriptionString;
@property (nonatomic) bool isRoot;
@property (nonatomic) int parentId;

UFCategory * categoryFormDic(NSDictionary *dic);

@end

@interface UFImage : UFType

@property (nonatomic) NSString *idString;
@property (nonatomic) NSString *name;
@property (nonatomic) NSString *url;
@property (nonatomic) int displayOrder;
@property (nonatomic) NSString *urlPath;

NSArray *ufimagesFromArray(NSArray *array);
UFImage *ufimageFromDic(NSDictionary *dic);

@end

@interface UFItemTitle : UFType

@property (nonatomic) NSString *name;
@property (nonatomic) NSString *title;
@property (nonatomic) NSString *value;

NSArray *itemTitleListFromArray(NSArray *array);
UFItemTitle *itemTitleFromDic(NSDictionary *dic);

@end

@interface UFProductInfo : UFType


@property (nonatomic) int saledNum;
@property (nonatomic) NSArray *propertyList;
@property (nonatomic) BOOL isReserve;
@property (nonatomic) BOOL isCollect;
@property (nonatomic) NSString *descriptionString;
@property (nonatomic) int inventory;
@property (nonatomic) BOOL isDownLoad;
@property (nonatomic) int productCollectCount;
@property (nonatomic) NSString *price;
@property (nonatomic) UFSupplier *supplier;
@property (nonatomic) NSString *name;
@property (nonatomic) NSDictionary *itemList;
@property (nonatomic) NSString *idString;
@property (nonatomic) UFCategory *category;
@property (nonatomic) NSArray *imageList;
@property (nonatomic) BOOL isHot;
@property (nonatomic) NSArray *itemTitleList;
@property (nonatomic) NSUInteger itemSelectedIndex;//已选择的规格
@property (nonatomic) NSString *intro;

UFProductInfo *productInfoFormDic(NSDictionary *dic);
UFProductInfo *productInfoFormProduct(UFProduct *pro);

@end


@interface UFInvoice : UFType

@property (nonatomic) NSString *title;
@property (nonatomic) NSString *type;

@end

@interface UFShoppingProduct : UFType

//@property (nonatomic) NSString *cartId;
@property (nonatomic) NSString *productItemId;
@property (nonatomic) NSUInteger quantity;

@end

@interface UFShoppingInfo : UFType

@property (nonatomic) NSString *shopId;
@property (nonatomic) NSString *productType;
@property (nonatomic) NSString *useCoupon;
@property (nonatomic) UFShoppingProduct *product;

@end


@interface UFAddressInfo : UFType

@property (nonatomic) NSString *idString;
@property (nonatomic) BOOL isNewRecord;
//@property (nonatomic) NSString *provinceId;
//@property (nonatomic) NSString *province;
//@property (nonatomic) NSString *cityId;
//@property (nonatomic) NSString *city;
//@property (nonatomic) NSString *districtId;
//@property (nonatomic) NSString *district;
@property (nonatomic) NSString *detailAddress;
@property (nonatomic) NSString *deliveryName;
@property (nonatomic) NSString *deliveryPhone;
@property (nonatomic) NSString *name;
@property (nonatomic) BOOL def;

NSArray *addressesFromArray(NSArray *array);
UFAddressInfo *addressFromDic(NSDictionary *dic);

@end



@interface UFOrderInfo : UFType

@property (nonatomic) NSString *idString;
@property (nonatomic) NSString *orderNum;
@property (nonatomic) NSTimeInterval createDate;
@property (nonatomic) double totalPrice;
@property (nonatomic) NSString *receiveUserName;
@property (nonatomic) NSString *city;
@property (nonatomic) NSString *paymentId;
@property (nonatomic) NSString *province;
@property (nonatomic) NSString *district;
@property (nonatomic) NSString *receiveDetailAddress;
@property (nonatomic) NSString *receivePhoneNum;
@property (nonatomic) int totalProductNum;
@property (nonatomic) int reFundcount;
@property (nonatomic) int orderType;
@property (nonatomic) NSString *productType;
@property (nonatomic) NSArray *productItems;
@property (nonatomic) NSArray *orderShips;

NSArray *ordersFromArray(NSArray *array);
UFOrderInfo *orderFromDic(NSDictionary *dic);

@end

@interface UFProductItem : UFType

@property (nonatomic) NSString *productItemId;
@property (nonatomic) NSString *productId;
@property (nonatomic) NSString *levelUrl;
@property (nonatomic) NSString *orderItemId;
@property (nonatomic) NSString *productName;
@property (nonatomic) NSString *itemName;
@property (nonatomic) double itemPrice;
@property (nonatomic) int quantity;
@property (nonatomic) NSString *mainUrl;
@property (nonatomic) int itemSaleEarning;
@property (nonatomic) int itemBonusEarning;
@property (nonatomic) NSString *allreFundStatus;
@property (nonatomic) NSString *checkRefundStatus;
@property (nonatomic) NSString *type;
@property (nonatomic) NSString *productType;

NSArray *productItemsFromArray(NSArray *array);
UFProductItem *productItemFromDic(NSDictionary *dic);

@end

@interface UFPayStyle : UFType

@property (nonatomic) NSString *idString;
@property (nonatomic) NSString *name;
@property (nonatomic) NSString *imageName;
@property (nonatomic) BOOL selected;

UFPayStyle *payStyleMake(NSString *make_id, NSString *make_name, NSString *make_imagename, BOOL make_selected);

@end

@interface UFShipInfo : UFType

@property (nonatomic) NSString *idString;
@property (nonatomic) NSString *note;
@property (nonatomic) NSString *operBy;
@property (nonatomic) NSString *orderId;
@property (nonatomic) NSTimeInterval shippedDate;
@property (nonatomic) NSString *shippedNum;
@property (nonatomic) NSString *shipper;

NSArray *shipsFromArray(NSArray *array);
UFShipInfo *shipFromDic(NSDictionary *dic);

@end




